<template>
  <div class="footer_guide">
    <!-- 动态绑定的对象语法：有类名，只是不确定使不使用 -->
    <a href="javascript:;" class="guide_item" :class="{on: '/msite'===$route.path}" @click="goTo('/msite')">
      <span class="item_icon">
        <i class="iconfont icon-waimai"></i>
      </span>
      <span>外卖</span>
    </a>
    <a href="javascript:;" class="guide_item" :class="{on: '/search'===$route.path}" @click="goTo('/search')">
      <span class="item_icon">
        <i class="iconfont icon-search"></i>
      </span>
      <span>搜索</span>
    </a>
    <a href="javascript:;" class="guide_item" :class="{on: '/order'===$route.path}" @click="goTo('/order')">
      <span class="item_icon">
        <i class="iconfont icon-dingdan"></i>
      </span>
      <span>订单</span>
    </a>
    <a href="javascript:;" class="guide_item" :class="{on: '/profile'===$route.path}" @click="goTo('/profile')">
      <span class="item_icon">
        <i class="iconfont icon-geren"></i>
      </span>
      <span>我的</span>
    </a>
  </div>
</template>

<script>
  export default {
    name: 'FooterGuide',
    components:{
  
    },
    methods: {
      goTo(path) {
        this.$router.replace(path)
      },
    }
  }
</script>

<style lang="less">
  @import '../../common/less/mixins.less';
  .footer_guide {
    .top-border-1px(@bc);
    position: fixed;
    z-index: 100;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    width: 100%;
    height: 50px;
    display: flex;
    .guide_item {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      margin: 5px;
      color: #999;
      span {
        font-size: 12px;
        margin-top: 2px;
        margin-bottom: 2px;
        .iconfont {
          font-style: 22px;
        }
      }
    }
    .on {
      color: #02a774;
    }
  }
</style>